# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/22 18:03
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('QSS样式声明学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		# label = QTextEdit("标签测试"*3,self)
		label = QSpinBox(self)
		# layout = QVBoxLayout(self)
		# layout.addWidget(label)

		# label.setFont(QFont())
		label.resize(300,300)
		label.move(0,0)
		self.qss边框(label)

	def qss边框(self,label):

		label.setStyleSheet("""
			QSpinBox{
				font-size:26px;
				color:orange;
				border:10px double red;
				border-radius:10px;
				background-color:lightgray;		
			}
			QSpinBox::up-button,QSpinBox::down-button{
				width:50px;
				height:50px;
			}
			QSpinBox::up-button{
				subcontrol-origin:padding;
				subcontrol-position:left center;
				image:url(./up.png)
			}
			QSpinBox::down-button{
				subcontrol-origin:padding;
				subcontrol-position:right center;
				image:url(./down.png)
			}
			QSpinBox::up-button:hover{
				bottom:10px
			}
			QSpinBox::down-button:hover{
				top:100px;
				position:absolute;
			}
			
		""")


		return None
		label.setStyleSheet("""
			QTextEdit{
				font-family:隶书;
				font-size:30px;
				font-style:italic;
				font-weight:900;
				color:orange;
				
				min-width:200px;
				min-height:200px;
				
				max-width:600px;
				max-height:600px;
			}
		""")
		# label.setStyleSheet("""
		# 	QTextEdit {
		# 		background-color:rgb(100,200,100);
		# 		background-image:url(./desktop.png);
		# 		background-repeat:no-repeat;
		# 		background-position:bottom right;
		# 		background-origin:border;
		# 		background-clip:padding;
		# 		background-attachment:fixed;
		#
		# 		color:red;
		# 		border:20px double red;
		# 		padding:20px;
		# 		margin:20px;
		#
		# 		font-family:隶书
		#
		# 	}
		# """)




if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())